package com.sys.utils;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
 
/**
 * @author jack
 *
 */
public class Bean implements Serializable{
	private static final long serialVersionUID = 1L;
	private Map<String, Object> p = new HashMap<String, Object>();

	public Map<String, Object> getP() {
		return p;
	}
	
	public void clear() {
		p.clear();
	}

	public void setP(Map<String, Object> p) {
		this.p.clear();
		for (String key : p.keySet()) {
			this.p.put(key, (Serializable) p.get(key));
		}
	}


	public void set(String field, Object value) {
		p.put(field, value);
	}

	@SuppressWarnings({ "unchecked", "hiding" })
	public <T> T get(String field) {
		return (T) p.get(field);
	}
	
	
	public String toString() {
		return p.toString();
	}

}
